import request from '@/config/axios'

// 账号平台 VO
export interface AccountTypeVO {
  id: number // 编号
  name: string // 平台名称
}

// 账号平台 API
export const AccountTypeApi = {
  // 查询账号平台分页
  getAccountTypePage: async (params: any) => {
    return await request.get({ url: `/member/account-type/page`, params })
  },

  // 获取账号平台列表
  getAccountTypeList: async () => {
    return await request.get({ url: `/member/account-type/list` })
  },

  // 查询账号平台详情
  getAccountType: async (id: number) => {
    return await request.get({ url: `/member/account-type/get?id=` + id })
  },

  // 新增账号平台
  createAccountType: async (data: AccountTypeVO) => {
    return await request.post({ url: `/member/account-type/create`, data })
  },

  // 修改账号平台
  updateAccountType: async (data: AccountTypeVO) => {
    return await request.put({ url: `/member/account-type/update`, data })
  },

  // 删除账号平台
  deleteAccountType: async (id: number) => {
    return await request.delete({ url: `/member/account-type/delete?id=` + id })
  },

  // 导出账号平台 Excel
  exportAccountType: async (params) => {
    return await request.download({ url: `/member/account-type/export-excel`, params })
  }
}
